#ifndef FUC_OPTICAL_H
#define FUC_OPTICAL_H

#include "stm32f4xx.h"

/* PWM输入捕获引脚 */
#define ADVANCE_ICPWM_GPIO_CLK          RCC_AHB1Periph_GPIOC
#define ADVANCE_ICPWM_PIN               GPIO_Pin_6
#define ADVANCE_ICPWM_GPIO_PORT         GPIOC
#define ADVANCE_ICPWM_PINSOURCE			GPIO_PinSource6
#define ADVANCE_ICPWM_AF				GPIO_AF_TIM8
#define ADVANCE_IC1PWM_CHANNEL          TIM_Channel_1
/* 捕获/比较中断 */
#define ADVANCE_TIM_IRQn			    TIM8_CC_IRQn
#define ADVANCE_TIM_IRQHandler        	TIM8_CC_IRQHandler

//高级控制定时器
#define ADVANCE_TIM           		    TIM8
#define ADVANCE_TIM_CLK       		    RCC_APB2Periph_TIM8

//输入捕获能捕获到的最小频率/168M/{ (ARR+1)*(PSC+1) }
//这里配置为1KHz
#define ADVANCE_TIM_PERIOD            	(1000-1)
#define ADVANCE_TIM_PSC               	(168-1)

void TIM_PWMINPUT_Config(void);
#endif //FUC_OPTICAL_H
